package com.lemonfish.pojo.entity;

import java.util.Date;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.diboot.core.entity.BaseEntity;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 商品 Entity定义
 * @author Lemonfish
 * @version 1.0
 * @date 2020-03-11
 * Copyright © Chao Zhang
 */
@ApiModel(value = "商品")
@Getter
@Setter
@Accessors(chain = true)
public class Goods extends BaseCustomEntity {

    private static final long serialVersionUID = -1670466199092612917L;

    // 商品名称
    @ApiModelProperty(value = "商品名称", example = "1")
    @Length(max = 100, message = "商品名称长度应小于100")
    @TableField()
    private String name;

    // 商品价格
    @ApiModelProperty(value = "商品价格", example = "1.2")
    @TableField()
    private Double price;

    // 厂商
    @ApiModelProperty(value = "厂商", example = "蒙牛")
    @Length(max = 100, message = "厂商长度应小于100")
    @TableField()
    private String company;

    // 商品详情
    @ApiModelProperty(value = "商品详情", example = "123")
    @Length(max = 1000, message = "商品详情长度应小于1000")
    @TableField()
    private String detail;

    // 图片路径
    @ApiModelProperty(value = "图片路径", example = "123")
    @Length(max = 333, message = "图片路径长度应小于333")
    @TableField()
    private String picPath;

    // 更新时间
    @ApiModelProperty(value = "更新时间", example = "2020-03-12 02:41")
    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;
}
